package com.example.demo;


public class Tax {

    public static void main(String[] args) {
        double income = 25000; //
        double tax = calculateTax(income);
        System.out.println("Income: $" + income);
        System.out.println("Tax: $" + tax);
    }
    public static double calculateTax(double income) {
        double tax = 0.0;

        if (income <= 10000) {
            tax = income * 0.00; // 0% tax
        } else if (income <= 20000) {
            tax = (income - 10000) * 0.10; // 10% tax on income above $10,000
        } else {
            tax = (10000 * 0.00) + (10000 * 0.10) + ((income - 20000) * 0.20); // 10% tax on income between $10,001 and $20,000, 20% tax on income above $20,000
        }

        return tax;
    }
}



